package com.own.business.log.login.persistence.controller.manage;

import com.own.business.log.login.persistence.business.service.LogLoginService;
import com.own.business.log.login.persistence.entity.query.LogLoginQuery;
import com.own.business.log.login.persistence.entity.vo.LogLoginVo;
import com.own.component.common.base.controller.BaseController;
import com.own.component.common.model.PageModel;
import com.own.component.common.model.R;
import com.own.component.common.model.ResultModel;
import com.own.component.log.operation.aop.LogOperationAop;
import com.own.constant.ConstantApiPrefix;
import com.own.constant.ConstantBeanSuffix;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * ManageLogLoginPersistenceController
 *
 * @author chenxueli
 * @date 2023-08-03 09:30:47
 */
@Tag(name = "登录日志持久化" + ConstantBeanSuffix.MANAGE_CLIENT + ConstantBeanSuffix.CONTROLLER)
@RestController
@RequestMapping(ConstantApiPrefix.BASE_API_V1_PREFIX + ConstantApiPrefix.MANAGE_CLIENT + "log/login")
public class ManageLogLoginPersistenceController extends BaseController {

    @Resource
    private LogLoginService logLoginService;

    @LogOperationAop
    @Operation(summary = "分页查询信息")
    @PostMapping("/page")
    public ResultModel<PageModel<LogLoginVo>> page(
            @RequestBody LogLoginQuery query
    ) {
        var pageModel = logLoginService.page(query);
        return R.success(pageModel);
    }

}
